from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time

testCase = "DBshop0024_商品管理商品评价删除"

firefox = openBrowser(urlAdmin)
#调用自定义函数进行后台的登录
DBshopLoginAdmin(firefox)
#调用后台的菜单操作函数
DBshopEnterMenu2(firefox,'商品管理','商品评价')
firefox.find_element_by_link_text("编辑查看").click()
firefox.find_element_by_xpath("//td[contains(.,'下次还是会回购')]/following-sibling::td[4]/a[2]").click()
firefox.switch_to.alert.accept()

def sysTime():
    return time.strftime("%Y-%m-%d %H:%M", time.localtime())
print(time.localtime())

print(sysTime())
# 断言
s=firefox.find_element_by_xpath("//tbody").text
l="回复时间："
r=" 回复人："
order=reGetString(s,l,r)
yuqi=sysTime()
if yuqi==order:
    writeLog("%s 测试失败" % testCase)
else:
    writeLog("%s 测试通过" % testCase)
    getPhoto(firefox)
firefox.quit()